<template>
  <!-- 头部组件 -->
  <div class="header-box" style="display:none;">
    <div class="header-fix">
      <div class="head-icon" v-if="hasArrow" @click="goBack"></div>
      {{title}}
    </div>
  </div>
</template>

<script>
export default {
  //标题，是否有返回键，返回路径
  props:["title","hasArrow","url"],
  methods:{
    goBack(){
      if(this.url){
        var _this = this;
        this.$router.push({
          path:_this.url
        })
      }else{
        this.$router.go(-1);
      }
      
    }
  }
}
</script>

<style scoped>
.header-box{
  height: 44px;
  line-height: 44px;
  background: #7CA7F3;
  text-align: center;
  font-size: 16px;
  color: #fff;
  position: relative;
  padding:0 36px;
  z-index: 2;
}
.header-fix{
  position: fixed;
  top:0;
  left: 0;
  right: 0;
  height: 44px;
  background: #7CA7F3;
}
.head-icon{
  border-top:2px solid #fff;
  border-left: 2px solid #fff;
  width: 12px;
  height: 12px;
  transform:rotate(-45deg);
  position: absolute;
  left: 16px;
  top:15px;
}
</style>